home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / AmigaUtil / TimerUtil.mod < prev   
Text File  |  1994-08-08  |  1KB  |  55 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: TimerUtil.mod $
  4.   Description: Support for clients of timer.device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 16:09:29 $
  10.  
  11.   Copyright © 1994, Frank Copeland.
  12.   This file is part of the Oberon-A Library.
  13.   See Oberon-A.doc for conditions of use and distribution.
  14.  
  15. ***************************************************************************)
  16.  
  17. MODULE TimerUtil;
  18.  
  19. (*
  20. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  21. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  22. ** $V- OvflChk       $Z- ZeroVars
  23. *)
  24.  
  25. IMPORT E := Exec, EU := ExecUtil, Ti := Timer;
  26.  
  27. (*------------------------------------*)
  28. (*
  29.  * An AmigaDOS 1.3 implementation of the AmigaDOS 2.0+ function.  Based on
  30.  * an example in the 2nd edition RKM:Libraries and Devices.
  31.  *)
  32. PROCEDURE GetSysTime *
  33.   ( req : Ti.TimeRequestPtr; VAR dest : Ti.TimeVal );
  34.  
  35.   VAR port : E.MsgPortPtr; result : SHORTINT;
  36.  
  37. BEGIN (* GetSysTime *)
  38.   dest.secs := 0; dest.micro := 0; port := NIL;
  39.   IF req.replyPort = NIL THEN
  40.     port := EU.CreatePort ("", 0);
  41.     IF port # NIL THEN req.replyPort := port
  42.     ELSE RETURN
  43.     END
  44.   END;
  45.   req.type := E.ntMessage;
  46.   req.pri := 0;
  47.   req.name := NIL;
  48.   req.command := Ti.getSysTime;
  49.   result := E.base.DoIO (req);
  50.   dest := req.time;
  51.   IF port # NIL THEN EU.DeletePort (port) END
  52. END GetSysTime;
  53.  
  54. END TimerUtil.
  55.